/*
 * @Description: 
 * @Author: changqing
 * @Date: 2021-08-30 16:32:18
 * @LastEditTime: 2021-08-30 16:32:19
 * @LastEditors: changqing
 * @Usage: 
 */
var { timer, interval,range } = require('rxjs'); 
var {skipUntil,map} = require('rxjs/operators');

// skipUntil会持续忽略数据，直到指定的Observable发出新的事件时，才会开始

onst click = fromEvent(document.querySelector('#btnStart'), 'click');
const source = interval(1000);

source.pipe(
  skipUntil(click)
).subscribe(data => console.log(`${data}`));
// 点击按钮后才开始触发订阅